home *** CD-ROM | disk | FTP | other *** search
- <html>
-
- <head>
-
- <title>Doorway</title>
-
- </head>
-
- <script language="JavaScript">
-
- <!---//
-
- //first set up a global variable to hold the result returned by
-
- //the whichVersion() function
-
- var b = whichVersion()
-
- //the standard whichVersion function
-
- function whichVersion() {
-
- var myBrowser = navigator.userAgent;
-
- if((myBrowser.lastIndexOf("MSIE") != -1) &&
-
- (myBrowser.lastIndexOf("4.0") != -1)) return "IE4"
-
- if((myBrowser.lastIndexOf("MSIE") != -1) &&
-
- (myBrowser.lastIndexOf("3.0") != -1)) return "IE3"
-
- if((myBrowser.lastIndexOf("2.0") != -1) return "NS2"
-
- if((myBrowser.lastIndexOf("3.0") != -1) &&
-
- (myBrowser.lastIndexOf("MSIE") == -1)) return "NS3"
-
- if((myBrowser.lastIndexOf("4.0") != -1) &&
-
- (myBrowser.lastIndexOf("MSIE") == -1)) return "NS4"
-
- }
-
- //this version of the routeMe() function changes the current
-
- //window's location to Netscape's page.
-
- function routeMe() {
-
- var exitMsg = ''; //a placeholder for the exit message
-
- var exitURL = ''; //a placeholder for the exit URL
-
- //first check to see if "NS"is in the string b
-
- //which we assigned the result of whichVersion to
-
- if (b.lastIndexOf("NS" != -1)){
-
- exitURL = "http://www.netscape.com/";
-
- } else {
-
- exitURL = "http://www.microsoft.com/";
-
- }
-
- //now it's just simple string matching to check the
-
- //version and assign an exit message to the user
-
- if (b == "NS3") { exitMsg = 'Netscape 3.0? Upgrade to 4.0!'; }
-
- if (b == "NS2") { exitMsg = 'Netscape 2.0? Upgrade to 4.0!'; }
-
- if (b == "IE3") { exitMsg = 'Internet Explorer 3? Try 4.0!'; }
-
- //one of my favorite tricks. If the exitMsg variable
-
- //is not blank, then perform some action. In this case
-
- //it's to alert the user to a possible upgrade
-
- if (exitMsg != '') {
-
- alert('An Upgrade Is Available!\n' + exitMsg);
-
- }
-
- self.location = exitURL;
-
- }
-
- //--->
-
- </script>
-
- <body bgcolor="#ffffff">
-
- <center>
-
- <form>
-
- <input type="button" onClick="routeMe()" value="Go Home!">
-
- </form>
-
- </center>
-
- </body>
-
- </html>
-
-